package Game;

import java.util.Map;
import java.util.Map.Entry;

public class StringFilter {
	
	private static final Map<String, String> filter;
	
	static {
		filter = IO.loadFilter(IO.getResource("\\Ressources\\filter"));
	}
	
	private StringFilter() {};
	
	public static String filterString(String input) {
		for (Entry<String, String> entry : filter.entrySet()) {
			input = input.replaceAll(entry.getKey(), entry.getValue());
		}
		return input;
	}
	
	public static void addWordToFilter(String regex, String replacement) {
		filter.put(regex, replacement);
	}

}
